package proyectoFC_2_3_3.koyicabuto;

import java.util.ArrayList;

import proyectoFC_2_3_3.koyicabuto.balloonOverlay.BalloonItemizedOverlay;

import android.content.Context;
import android.graphics.drawable.Drawable;

import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;

public class MyItemizedOverlay extends BalloonItemizedOverlay<OverlayItem>{
	
	private ArrayList<OverlayItem> m_overlays = new ArrayList<OverlayItem>();
	private Context c;
	
	public MyItemizedOverlay(Drawable defaultMarker, MapView mapView, String bandera) {
		super(boundCenter(defaultMarker), mapView, bandera);
		c= mapView.getContext();
	}
	
	@Override
	protected OverlayItem createItem(int i) {
		return m_overlays.get(i);
	}
	
	@Override
	public int size() {
		return m_overlays.size();
	}

	public void addOverlay(OverlayItem overlay) {
		m_overlays.add(overlay);
		populate();
	}
	
	void clearOverlay() {
		m_overlays.clear();
		populate();
	}

}
